﻿namespace Example
{
    using WatiN.Core;

    using Xunit;

    public sealed class AlanDeanFacts
    {
        [Fact(Skip = "System.Runtime.InteropServices.COMException : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)")]
        public void internet_explorer()
        {
            using (var browser = new IE("http://www.alan-dean.com/about"))
            {
                Assert.Equal("Alan Dean", browser.Title);

                browser.Link(Find.BySelector("a[href=\"/presence\"]")).Click();

                Assert.Equal("Alan Dean", browser.Title);
            }
        }

        [Fact(Skip = "WatiN.Core.Native.Mozilla.FireFoxException : Unable to connect to jssh server, please make sure you have correctly installed the jssh.xpi plugin")]
        public void firefox()
        {
            using (var browser = new FireFox("http://www.alan-dean.com/about"))
            {
                Assert.Equal("Alan Dean", browser.Title);

                browser.Link(Find.BySelector("a[href=\"/presence\"]")).Click();

                Assert.Equal("Alan Dean", browser.Title);
            }
        }
    }
}